<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>
    	<spring:message code="head.clothGarment"></spring:message>-
    	<spring:message code="head.userCenter"></spring:message>-
    	<spring:message code="head.personalInformation"></spring:message>
    </title>
    <!--公共样式-->
    <link href="${pageContext.request.contextPath }/web/css/font/iconfont.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/web/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/NormalizeFile.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/public.css" />
    <!--列表页面私有样式-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/person.css" />
    <link href="${pageContext.request.contextPath }/h-ui/lib/Validform/style.css" rel="stylesheet" type="text/css" />
</head>
<body style="min-width: 0px;">
<!--用户中心 begin-->
    <!--收货地址-->
        <div class="adress-content">
            <form id="address" action="${pageContext.request.contextPath }/web/address/insertaddress">
            <ul>
                <li>
                    <span><spring:message code="reciveAddress.name"></spring:message>：</span>
                    <input type="text" name="aName" datatype="s2-30" class="input-modify" nullmsg="<spring:message code='qingtianxiexinxi'></spring:message>" errormsg="<spring:message code='qingshurumingcheng'></spring:message>"/> 
                </li>
                <li>
                    <span><spring:message code="reciveAddress.mobilePhoneNumber"></spring:message>：</span>
                    <input type="text" name="aPhone" datatype="m" class="input-modify" nullmsg="<spring:message code='qingtianxiexinxi'></spring:message>" errormsg="<spring:message code='qingshuruzhengqueshoujihao'></spring:message>"/>
                </li>
                 <li>
                    <span class="f-l"><spring:message code="reciveAddress.localArea"></spring:message>：</span>
                    <div data-toggle="distpicker" style="float:left;width:700px;margin-left:4px;">
                      <select datatype="*" name="sheng" class="sel1 bor1" nullmsg="<spring:message code='qingxuanze'></spring:message>"></select>
                      <select datatype="*" name="shi" class="sel2 bor1"></select>
                    </div>
                    <div class="clearfix"></div>
                </li>
                <li style="height:100px;">
                    <span><spring:message code="reciveAddress.detailedAddress"></spring:message>：</span>
                    <textarea name="aAddressInfo" datatype="*"  nullmsg="<spring:message code='qingtianxiexinxi'></spring:message>" placeholder="<spring:message code="reciveAddress.pleaseEnterDetailedAddress"></spring:message>" class="bor1"></textarea>
                </li>
                <li>
                    <span><spring:message code="reciveAddress.zipCode"></spring:message>：</span>
                    <input type="text" name="aCode" datatype="p"  class="input-modify" nullmsg="<spring:message code='qingtianxiexinxi'></spring:message>" errormsg="<spring:message code='qingshuruzhengqueyoubian'></spring:message>" class="input-modify"/>
                </li>
            </ul>
            <div style="text-align:center;margin-top:10px ">
            <button type="submit" class="btn-red"><spring:message code="reciveAddress.save"></spring:message></button>
            </div>
            </form>
        </div>
<!--用户中心 end-->
<!--全局-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/public.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/2.1/layer.js"></script>
<!--ie789下placeholder不兼容-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/placeholder.js"></script>
<!--头部的以图搜图-->
<%-- <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/uppicFile.js"></script> --%>
<!--用户中心-->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/subpage/person.js"></script>

<!-- 地址联动 -->
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/distpicker/distpicker.data.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/distpicker/distpicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/web/js/distpicker/main.js"></script>


<script type="text/javascript">


$(function(){
	$.Tipmsg.w["p"]="请填写正确邮编！";
	$.Tipmsg.r=null;
	var showmsg=function(msg){
		if(msg=="正在提交数据…"){
			return;
		}
		layer.msg(msg, {icon: 0,time: 1000}); 
	}
	$("#address").Validform({
		ajaxPost:true,
		tiptype:function(msg){
			showmsg(msg);
		},
		tipSweep:true,
		callback:function(result){
			 var status=result.msg.status;
			 var desc=result.msg.desc;
			 if(status == 0){
				layer.msg("<spring:message code='baocunchenggong'></spring:message>", {icon: 1,time: 1000}); 
				parent.$("#mai").submit();
			 }else if(status == 3){//只能添加3条记录
				layer.msg("<spring:message code='zhinengtianjia3tiaojilu'></spring:message>", {icon: 0,time: 1000}); 
			 }else if(status == 2){//没登录
				layer.msg("<spring:message code='weidenglu'></spring:message>", {icon: 0,time: 1000}); 
			    }else if(status ==1){//失败
			    	layer.msg("<spring:message code='caozuoshibai'></spring:message>", {icon: 0,time: 1000}); 
			    }
			 }
	});
});


</script>
</body>
</html>